#ifndef _SQSTACK_H_
#define _SQSTACK_H_

#include <stdio.h>
#include <stdlib.h>
#include "declare.h"

#define BUTTOM -1

struct stStack {
    POSITION top;
    ELEMTYPE *buffer;
    SIZE_T MAXNUM;
    SIZE_T length;
};

typedef struct stStack *PSeqStack;

PSeqStack createEmptyStack(int m);
int isEmpty(PSeqStack pstack);
int isFull(PSeqStack pstack);
int push(PSeqStack pstack, ELEMTYPE x);
int pop(PSeqStack pstack);
int top(PSeqStack pstack, ELEMTYPE *x);
SIZE_T length(PSeqStack pstack);
int empty(PSeqStack pstack);
int destroy(PSeqStack *pstack);
int printStack(PSeqStack pstack);
#endif
